 	PRO LEER_GLOBALS,dir,g,NN
; globals.out file:
; First line: nx,ny,nstep,nstg,dt,xnu,xeta,eps,kf1,kf2
; From second line until end: time,eneut,enebt,eneuet,
; sqwt,sqjt,asqt,hct,eneuzt,enebzt,eneuezt,hmt,hht

file=dir+'globals.out'
num=50000; num has to be greater than #lines in globals.out
g=dblarr(14,num)
openr,1,file
NN=-1
dt=0.d0
xnu=dt
xeta=dt
eps=dt
a1=0.d0 & a2=a1 & a3=a1 & a4=a1 & a5=a1 & a6=a1
a7=a1 & a8=a1 & a9=a1 & a10=a1 & a11=a1 & a12=a1 & a13=a1 & a14=a1
readf,1,nx,ny,nstep,nstg,dt,xnu,xeta,eps,kf1,kf2
while not eof(1) do begin
NN=NN+1
readf,1,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14
g(0:13,NN)=[a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14]
endwhile
close,1
print,'======================================================================='
print, 'Numero de lineas en globals.out: ',NN+2 
print,'======================================================================='
end
